package 笔试2.网易.four;

import org.junit.Test;

public class Main2 {
    public static void main(String[] args) {
        int[] a = {0,1,0,1,0};


        int st=1;
        int max = a[st-1];
        int res=0;
        for (int i = st-1+1; i <a.length; i++) {
            if(a[i]>=max){
                max=a[i];
                res++;
            }
        }
        System.out.println(res);
    }

    @Test
    public void test() {
        int[] a = {0,1,0,1,0};


        int st=1;
        int max = a[st-1];
        int res=0;
        for (int i = st-1+1; i <a.length; i++) {
            if(a[i]>=max){
                max=a[i];
                res++;
            }
        }
        System.out.println(res);
    }
}
